﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BusinessLibrary.DAL;
namespace BusinessLibrary.BLL
{
   public class Specialite
    {
        # region var
        public int  Id { get; set; }
        public string Nom { get; set; }
        public string Abreviation { get; set; }
        public Departement departement { get; set; } 

        #endregion
        #region methodes
        /// <summary>
        /// 
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public static Specialite GetSpecialiteById(int id)
        {
            return sqlSpecialite.GetSpecialiteById(id);
        }


        public static int deleteSpecialite(int id, string nom, string abreviation, int id_departement)
        {
            return sqlSpecialite.deletSpecialite(id,nom,abreviation, id_departement);
        }


        public static int SaveSpecialite(Specialite s)
        {
            int nbRow;
            if ((nbRow = sqlSpecialite.updateSpecialite(s)) > 0)
                return nbRow;
            else
                return sqlSpecialite.insertSpecialite(s);
        }

        public static List<Specialite> GetListeListeSpecialite(int id_niveau)
        {
            return sqlSpecialite.SelectListeSpecialite(id_niveau);
        }
    }
        #endregion
    }

